local zong__huixiang = fk.CreateSkill {
  name = "zong__huixiang",
}

Fk:loadTranslationTable{
  ["zong__huixiang"] = "回想",
  [":zong__huixiang"] = "当你于弃牌阶段弃置红色基本牌后，若你没有护甲，你可以获得1点护甲。",
}

zong__huixiang:addEffect(fk.AfterCardsMove, {
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(zong__huixiang.name) and player.phase == Player.Discard and player.shield == 0 then
      for _, move in ipairs(data) do
        if move.from == player and move.moveReason == fk.ReasonDiscard then
          for _, info in ipairs(move.moveInfo) do
            local card = Fk:getCardById(info.cardId)
            if card.color == Card.Red and card.type == Card.TypeBasic then
              return true
            end
          end
        end
      end
    end
  end,

  on_use = function(self, event, target, player, data)
    player.room:changeShield(player, 1)
  end,
})

return zong__huixiang